<template>
  <div class="common-layout">
    <el-container>
      <el-aside width="250px" class="sidebar-container"><Sidebar/></el-aside>
      <el-container class="main-container">
        <el-header class="header-container"> 
          <Header/>
        </el-header>
        <el-main class="main-content">
          <router-view />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup>
import Sidebar from './Sidebar.vue'
import Header from './Header.vue'
</script>

<style scoped>
.common-layout {
  min-height: 100vh;
  display: flex;
}

.sidebar-container {
  min-height: 100vh;
  height: auto;
}

.main-container {
  min-height: 100vh;
  height: auto;
  display: flex;
  flex-direction: column;
}

.header-container {
  height: 100px;
  min-height: 100px;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  min-height: calc(100vh - 100px);
  height: auto;
  overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar-container {
    width: 200px !important;
  }
}

@media (max-width: 480px) {
  .sidebar-container {
    width: 180px !important;
  }
  
  .header-container {
    height: 80px;
    min-height: 80px;
  }
  
  .main-content {
    min-height: calc(100vh - 80px);
  }
}
</style>